<!--  -->
<template>
  <div class="singer_cotainer">
    <div class="singer_wrap">
      <div @click="toDetail(item.id)" v-for="(item, index) in singerList" :key="index" class="item">
        <el-image :src="item.img1v1Url" fit="cover"></el-image>
        <div class="name">{{ item.name }}</div>
      </div>
    </div>
  </div>
</template>

<script>
import { getSingerCollect } from "@/util/music.js";
import { mapGetters } from "vuex";

export default {
  name: "",
  data() {
    return {
      count: 0,
      singerList: [],
    };
  },
  created() {
    this.getSingerCollect();
  },
  computed: {
    ...mapGetters("userInfo", ["loginStatus"]),
  },
  methods: {
    async getSingerCollect() {
      let {
        data: { data },
      } = await getSingerCollect();
      // console.log(data);
      this.singerList = data
      //   this.count = data.count;
    },
    //跳转至歌手详情
    toDetail(id) {
      this.$router.push("/singerInfo/" + id);
    },
  },
};
</script>

<style scoped lang='less'>
.singer_wrap {
  display: grid;
  justify-content: space-around;
  align-content: center;
  grid-template-columns: repeat(auto-fill, 17rem);
  .item {
    text-align: center;
    .el-image {
      border-radius: 50%;
    }
    .name {
      font-size: 18px;
      font-weight: 600;
      margin-top: 10px;
    }
  }
}
</style>